package club.haomoon.core.mapper.system;

import club.haomoon.core.common.BaseDataMpper;
import club.haomoon.core.entity.system.SystemRoleMenuData;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * -------------------------
 * @Description: 系统菜单Mapper
 * @Author: Wangjianwei
 * @Date: 2025/02/12 15:28
 * -------------------------
 */
@Mapper
public interface SystemRoleMenuDataMapper extends BaseDataMpper<SystemRoleMenuData> {


    @Select("SELECT DISTINCT menuR.menu_id FROM cms_system_role_menu_data menuR INNER JOIN cms_system_role_data role ON menuR.role_id = role.id INNER JOIN cms_admin_role_data lar ON lar.role_id = role.id WHERE lar.admin_id = #{adminId} AND role.delete_time IS NULL")
    List<Integer> getMenuIds(@Param("adminId") Integer adminId);



}
